package com.zero.clinic.pojo;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

public class RecipeExample {
    protected String orderByClause;

    protected boolean distinct;

    protected List<Criteria> oredCriteria;

    public RecipeExample() {
        oredCriteria = new ArrayList<>();
    }

    public void setOrderByClause(String orderByClause) {
        this.orderByClause = orderByClause;
    }

    public String getOrderByClause() {
        return orderByClause;
    }

    public void setDistinct(boolean distinct) {
        this.distinct = distinct;
    }

    public boolean isDistinct() {
        return distinct;
    }

    public List<Criteria> getOredCriteria() {
        return oredCriteria;
    }

    public void or(Criteria criteria) {
        oredCriteria.add(criteria);
    }

    public Criteria or() {
        Criteria criteria = createCriteriaInternal();
        oredCriteria.add(criteria);
        return criteria;
    }

    public Criteria createCriteria() {
        Criteria criteria = createCriteriaInternal();
        if (oredCriteria.size() == 0) {
            oredCriteria.add(criteria);
        }
        return criteria;
    }

    protected Criteria createCriteriaInternal() {
        Criteria criteria = new Criteria();
        return criteria;
    }

    public void clear() {
        oredCriteria.clear();
        orderByClause = null;
        distinct = false;
    }

    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<>();
        }

        public boolean isValid() {
            return criteria.size() > 0;
        }

        public List<Criterion> getAllCriteria() {
            return criteria;
        }

        public List<Criterion> getCriteria() {
            return criteria;
        }

        protected void addCriterion(String condition) {
            if (condition == null) {
                throw new RuntimeException("Value for condition cannot be null");
            }
            criteria.add(new Criterion(condition));
        }

        protected void addCriterion(String condition, Object value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value));
        }

        protected void addCriterion(String condition, Object value1, Object value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value1, value2));
        }

        public Criteria andRecipeIdIsNull() {
            addCriterion("recipe_id is null");
            return (Criteria) this;
        }

        public Criteria andRecipeIdIsNotNull() {
            addCriterion("recipe_id is not null");
            return (Criteria) this;
        }

        public Criteria andRecipeIdEqualTo(Long value) {
            addCriterion("recipe_id =", value, "recipeId");
            return (Criteria) this;
        }

        public Criteria andRecipeIdNotEqualTo(Long value) {
            addCriterion("recipe_id <>", value, "recipeId");
            return (Criteria) this;
        }

        public Criteria andRecipeIdGreaterThan(Long value) {
            addCriterion("recipe_id >", value, "recipeId");
            return (Criteria) this;
        }

        public Criteria andRecipeIdGreaterThanOrEqualTo(Long value) {
            addCriterion("recipe_id >=", value, "recipeId");
            return (Criteria) this;
        }

        public Criteria andRecipeIdLessThan(Long value) {
            addCriterion("recipe_id <", value, "recipeId");
            return (Criteria) this;
        }

        public Criteria andRecipeIdLessThanOrEqualTo(Long value) {
            addCriterion("recipe_id <=", value, "recipeId");
            return (Criteria) this;
        }

        public Criteria andRecipeIdIn(List<Long> values) {
            addCriterion("recipe_id in", values, "recipeId");
            return (Criteria) this;
        }

        public Criteria andRecipeIdNotIn(List<Long> values) {
            addCriterion("recipe_id not in", values, "recipeId");
            return (Criteria) this;
        }

        public Criteria andRecipeIdBetween(Long value1, Long value2) {
            addCriterion("recipe_id between", value1, value2, "recipeId");
            return (Criteria) this;
        }

        public Criteria andRecipeIdNotBetween(Long value1, Long value2) {
            addCriterion("recipe_id not between", value1, value2, "recipeId");
            return (Criteria) this;
        }

        public Criteria andRecipeNameIsNull() {
            addCriterion("recipe_name is null");
            return (Criteria) this;
        }

        public Criteria andRecipeNameIsNotNull() {
            addCriterion("recipe_name is not null");
            return (Criteria) this;
        }

        public Criteria andRecipeNameEqualTo(String value) {
            addCriterion("recipe_name =", value, "recipeName");
            return (Criteria) this;
        }

        public Criteria andRecipeNameNotEqualTo(String value) {
            addCriterion("recipe_name <>", value, "recipeName");
            return (Criteria) this;
        }

        public Criteria andRecipeNameGreaterThan(String value) {
            addCriterion("recipe_name >", value, "recipeName");
            return (Criteria) this;
        }

        public Criteria andRecipeNameGreaterThanOrEqualTo(String value) {
            addCriterion("recipe_name >=", value, "recipeName");
            return (Criteria) this;
        }

        public Criteria andRecipeNameLessThan(String value) {
            addCriterion("recipe_name <", value, "recipeName");
            return (Criteria) this;
        }

        public Criteria andRecipeNameLessThanOrEqualTo(String value) {
            addCriterion("recipe_name <=", value, "recipeName");
            return (Criteria) this;
        }

        public Criteria andRecipeNameLike(String value) {
            addCriterion("recipe_name like", value, "recipeName");
            return (Criteria) this;
        }

        //自定义通过处方类型名称搜索的条件
        public Criteria andRecipeTypeNameLike(String value) {
            addCriterion("d.dictionary_name like", value, "recipeTypeName");
            return (Criteria) this;
        }

        public Criteria andRecipeNameNotLike(String value) {
            addCriterion("recipe_name not like", value, "recipeName");
            return (Criteria) this;
        }

        public Criteria andRecipeNameIn(List<String> values) {
            addCriterion("recipe_name in", values, "recipeName");
            return (Criteria) this;
        }

        public Criteria andRecipeNameNotIn(List<String> values) {
            addCriterion("recipe_name not in", values, "recipeName");
            return (Criteria) this;
        }

        public Criteria andRecipeNameBetween(String value1, String value2) {
            addCriterion("recipe_name between", value1, value2, "recipeName");
            return (Criteria) this;
        }

        public Criteria andRecipeNameNotBetween(String value1, String value2) {
            addCriterion("recipe_name not between", value1, value2, "recipeName");
            return (Criteria) this;
        }

        public Criteria andRecipeTypeIsNull() {
            addCriterion("recipe_type is null");
            return (Criteria) this;
        }

        public Criteria andRecipeTypeIsNotNull() {
            addCriterion("recipe_type is not null");
            return (Criteria) this;
        }

        public Criteria andRecipeTypeEqualTo(Long value) {
            addCriterion("recipe_type =", value, "recipeType");
            return (Criteria) this;
        }

        public Criteria andRecipeTypeNotEqualTo(Long value) {
            addCriterion("recipe_type <>", value, "recipeType");
            return (Criteria) this;
        }

        public Criteria andRecipeTypeGreaterThan(Long value) {
            addCriterion("recipe_type >", value, "recipeType");
            return (Criteria) this;
        }

        public Criteria andRecipeTypeGreaterThanOrEqualTo(Long value) {
            addCriterion("recipe_type >=", value, "recipeType");
            return (Criteria) this;
        }

        public Criteria andRecipeTypeLessThan(Long value) {
            addCriterion("recipe_type <", value, "recipeType");
            return (Criteria) this;
        }

        public Criteria andRecipeTypeLessThanOrEqualTo(Long value) {
            addCriterion("recipe_type <=", value, "recipeType");
            return (Criteria) this;
        }

        public Criteria andRecipeTypeIn(List<Long> values) {
            addCriterion("recipe_type in", values, "recipeType");
            return (Criteria) this;
        }

        public Criteria andRecipeTypeNotIn(List<Long> values) {
            addCriterion("recipe_type not in", values, "recipeType");
            return (Criteria) this;
        }

        public Criteria andRecipeTypeBetween(Long value1, Long value2) {
            addCriterion("recipe_type between", value1, value2, "recipeType");
            return (Criteria) this;
        }

        public Criteria andRecipeTypeNotBetween(Long value1, Long value2) {
            addCriterion("recipe_type not between", value1, value2, "recipeType");
            return (Criteria) this;
        }

        public Criteria andRecipeMoneyIsNull() {
            addCriterion("recipe_money is null");
            return (Criteria) this;
        }

        public Criteria andRecipeMoneyIsNotNull() {
            addCriterion("recipe_money is not null");
            return (Criteria) this;
        }

        public Criteria andRecipeMoneyEqualTo(BigDecimal value) {
            addCriterion("recipe_money =", value, "recipeMoney");
            return (Criteria) this;
        }

        public Criteria andRecipeMoneyNotEqualTo(BigDecimal value) {
            addCriterion("recipe_money <>", value, "recipeMoney");
            return (Criteria) this;
        }

        public Criteria andRecipeMoneyGreaterThan(BigDecimal value) {
            addCriterion("recipe_money >", value, "recipeMoney");
            return (Criteria) this;
        }

        public Criteria andRecipeMoneyGreaterThanOrEqualTo(BigDecimal value) {
            addCriterion("recipe_money >=", value, "recipeMoney");
            return (Criteria) this;
        }

        public Criteria andRecipeMoneyLessThan(BigDecimal value) {
            addCriterion("recipe_money <", value, "recipeMoney");
            return (Criteria) this;
        }

        public Criteria andRecipeMoneyLessThanOrEqualTo(BigDecimal value) {
            addCriterion("recipe_money <=", value, "recipeMoney");
            return (Criteria) this;
        }

        public Criteria andRecipeMoneyIn(List<BigDecimal> values) {
            addCriterion("recipe_money in", values, "recipeMoney");
            return (Criteria) this;
        }

        public Criteria andRecipeMoneyNotIn(List<BigDecimal> values) {
            addCriterion("recipe_money not in", values, "recipeMoney");
            return (Criteria) this;
        }

        public Criteria andRecipeMoneyBetween(BigDecimal value1, BigDecimal value2) {
            addCriterion("recipe_money between", value1, value2, "recipeMoney");
            return (Criteria) this;
        }

        public Criteria andRecipeMoneyNotBetween(BigDecimal value1, BigDecimal value2) {
            addCriterion("recipe_money not between", value1, value2, "recipeMoney");
            return (Criteria) this;
        }
    }

    public static class Criteria extends GeneratedCriteria {
        protected Criteria() {
            super();
        }
    }

    public static class Criterion {
        private String condition;

        private Object value;

        private Object secondValue;

        private boolean noValue;

        private boolean singleValue;

        private boolean betweenValue;

        private boolean listValue;

        private String typeHandler;

        public String getCondition() {
            return condition;
        }

        public Object getValue() {
            return value;
        }

        public Object getSecondValue() {
            return secondValue;
        }

        public boolean isNoValue() {
            return noValue;
        }

        public boolean isSingleValue() {
            return singleValue;
        }

        public boolean isBetweenValue() {
            return betweenValue;
        }

        public boolean isListValue() {
            return listValue;
        }

        public String getTypeHandler() {
            return typeHandler;
        }

        protected Criterion(String condition) {
            super();
            this.condition = condition;
            this.typeHandler = null;
            this.noValue = true;
        }

        protected Criterion(String condition, Object value, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.typeHandler = typeHandler;
            if (value instanceof List<?>) {
                this.listValue = true;
            } else {
                this.singleValue = true;
            }
        }

        protected Criterion(String condition, Object value) {
            this(condition, value, null);
        }

        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.secondValue = secondValue;
            this.typeHandler = typeHandler;
            this.betweenValue = true;
        }

        protected Criterion(String condition, Object value, Object secondValue) {
            this(condition, value, secondValue, null);
        }
    }
}